import http from '@/common/js/httpRequest'
//获取车间列表
export function getWorkshopList (params) {
  return http({
    method: 'get',
    url: '/api/sys/workshop/list',
    params
  })
}
//新增或修改车间
export function saveOrUpdateWorkshop (data) {
	const url = !data.workshopId ? '/api/sys/workshop/save' : '/api/sys/workshop/update'
  return http({
    method: 'post',
    url: url,
    data
  })
}
//删除角色
export function deleteWorkshop (ids) {
  return http({
    method: 'post',
    url: '/api/sys/workshop/delete',
    data: ids,
    openDefultdata: true
  })
}
//根据车间id获取制药用水取样点
export function getWaterGetListByWorkshopId (params) {
  return http({
    method: 'get',
    url: '/api/base/config/water/list',
    params
  })
}
//新增或修改取样点
export function saveOrUpdateWaterGet (data) {
	const url = !data.waterGetId ? '/api/base/config/water/save' : '/api/base/config/water/update'
  return http({
    method: 'post',
    url: url,
    data
  })
}
//删除取样点
export function deleteWaterGet (id) {
  return http({
    method: 'post',
    url: `/api/base/config/water/delete?waterGetId=${id}`,
    openDefultdata: true
  })
}
//获取环境测试对象
export function getEnvGetObjectList () {
  return http({
    method: 'get',
    url: '/api/base/config/env/objectlist'
  })
}
//获取环境取样频率
export function getEnvGetFrequencyList () {
  return http({
    method: 'get',
    url: '/api/base/config/env/frequencylist'
  })
}
//获取环境洁净级别
export function getEnvGetLevelList (params) {
  return http({
    method: 'get',
    url: '/api/base/config/env/levellist',
    params
  })
}
//根据workshopId、envGetObjectId、envGetFrequencyId获取环境取样点
export function getEnvGetListByParams (params) {
  return http({
    method: 'get',
    url: '/api/base/config/env/list',
    params
  })
}
//修改roomName/roomNum/cleanLevel名称bydata
export function updateEnvSomeCol (data) {
  return http({
    method: 'post',
    url: '/api/base/config/env/updatesomecol',
    data
  })
}
//修改getName
export function updateEnvGet (data) {
  return http({
    method: 'post',
    url: '/api/base/config/env/update',
    data
  })
}
//新增env
export function saveEnvGet (data) {
  return http({
    method: 'post',
    url: '/api/base/config/env/save',
    data
  })
}
//删除env
export function deleteEnvGet (id) {
  return http({
    method: 'post',
    url: `/api/base/config/env/delete?envGetId=${id}`,
    openDefultdata: true
  })
}
